x
if (key.length > ignoreSuffix.length && key.slice(key.length - ignoreSuffix.length) === ignoreSuffix)module teapo.app { export class TopLayout {​ private _drive: persistence.Drive = null; private _fileTree: teapo.files.FileTree = null; private _host: docs.DocHost = null; private _hostElement: HTMLElement = null; constructor() { } // TODO: extract add/remove handling in a separate place addClick() { var newFile = prompt('Create file:', this._fileTree.selectedFile() || '/' ); if (!newFile) return; if (this._drive.read(newFile) === null) { this._drive.write(newFile, ''); }​ // TODO select programmatically //this._fileTree.selectedFile(newFile); } deleteClick() { } initWithMainContent(mainContent: HTMLElement) { this._hostElement = mainContent; if (this._hostElement && this._fileTree) this._hostAndTreeLoaded(); } initWithTree(treeHost: HTMLElement) { try { var fileTree = new teapo.files.FileTree(treeHost);​ var uniqueKey = this._getUniqueKey(); var domTimestamp = 0;​ persistence.mountDrive( fileTree, uniqueKey, domTimestamp, <any>teapo.persistence, mountedDrive => { this._fileTree = fileTree; this._drive = mountedDrive; if (this._hostElement && this._fileTree) this._hostAndTreeLoaded(); }); } catch (error) {